package cn.lingyangwl.agile.misc.short_link.model.rqrs;

import cn.lingyangwl.agile.model.constants.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author shenguangyang
 */
@Getter
@Setter
public class BaseShortLink {
    @ApiModelProperty(value = "组id")
    @NotNull(message = ValidationCons.NOT_EMPTY)
    private Long groupId;

    @ApiModelProperty(value = "短链标题")
    private String title;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    private Long domainId;

    /**
     * JsonFormat 后台到前台的时间格式的转换
     * DateTimeFormat 前后到后台的时间格式的转换
     */
    @ApiModelProperty(value = "过期时间, 为空就是长久")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expireTime;

    @ApiModelProperty(value = "用户id, 不需要传递")
    private Long userId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态")
    private String status;
}
